#ifndef HOLE_H
#define HOLE_H

#include <QGraphicsItem>
#include "board.h"
#include "rock.h"

class Board;
class Rock;

class Hole : public QGraphicsItem
{
    qreal w_;
    qreal h_;
    int row_;
    int col_;
    Board* board_;
    bool hasRock_;
public:
    explicit Hole(Board* board, qreal w = 50.0, qreal h = 50.0, QGraphicsItem *parent = 0);

    QRectF boundingRect() const;
    QPainterPath shape() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void setCoords(int row, int col);
    int row() const;
    int col() const;
    qreal rockX() const;
    qreal rockY() const;

    bool hasRock();
    void setHasRock(bool hasRock);

    enum { Type = UserType + 1 };

    int type() const
    {
        // Enable the use of qgraphicsitem_cast with this item.
        return Type;
    }
    bool availableNextHole(Hole *hole);
    Rock* getRock();
    Board* getBoard();

signals:

public slots:

};

#endif // HOLE_H
